window.a0=window.a0||{};
a0.ItemCon=function(){
	var s = this;
	annie.Sprite.call(s);
	/*_a2x_need_start*/s.red_mc=null;s.yy_mc=null;/*_a2x_need_end*/
	annie.initRes(s,"a0","ItemCon");
    s.mouseChildren=false;
    s.name="icon";
    s.yy_mc.visible=false;
};
A2xExtend(a0.ItemCon,annie.Sprite);
a0.ItemCon.prototype.initData=function(id,data){
    var s=this;
    var iconItem=action.iconList[id];
    if(data){
        if(!iconItem){
            iconItem= new annie.Bitmap(annie.getResource("a0","sIcon"+id));
            var onload=function(){
                iconItem.anchorX = iconItem.bitmapData.width * .5;
                iconItem.anchorY = iconItem.bitmapData.height * .5;
                iconItem.x = (150 - iconItem.bitmapData.width) * .5;
                iconItem.y = (150 - iconItem.bitmapData.height) * .5;
                iconItem.bitmapData.onload=null;
            };
            if(iconItem.bitmapData.complete) {
                onload();
            }else{
                iconItem.bitmapData.onload=onload;
            }
        }
        if(s.obj){
            s.removeChild(s.obj);
        }
        s.obj= iconItem;
        s.type=data[0];
        s.runType=data[1];
        s.id=id;
        if(id!=action.checkId){
            s.obj.scaleX=s.obj.scaleY=0.78;
            s.yy_mc.visible=false;
            if(action.itemCheckList[id]==true){
                s.red_mc.gotoAndStop(2);
            }else{
                s.red_mc.gotoAndStop(1);
            }
        }else{
            s.obj.scaleX=s.obj.scaleY=1;
            s.yy_mc.visible=true;
            if(id==0){
                s.red_mc.gotoAndStop(1);
            }else{
                s.red_mc.gotoAndStop(3);
            }

        }
        s.addChildAt(s.obj,1);
    }else{
        s.id=-1;
        s.yy_mc.visible=false;
    }
}
